/**
 * 
 */
package cyber2d.core.objects;

//phys2d
import org.newdawn.slick.Image;
import org.newdawn.slick.SpriteSheet;

import net.phys2d.raw.Body;
import net.phys2d.raw.World;
import net.phys2d.raw.shapes.Box;

/**
 * @author Meraxupypr (Konstantin Petrukhnov)
 * 07.06.2007   1:40:24
 * 
 */

//contain type of shot
public class Shot extends UniverseObject
{

	public String description; //description for player
	
	//shots stats (dmg, speed, etc)
	public int damage;
	public float force; //force that will apply to shot when it puts to world
	
	//graphics assosiated
	SpriteSheet sprites;
	
	//sound
	
	//shot stage (in air, hit, exploded, etc)
	
	/**
	 * 
	 */
	public Shot(World w, String name, String description, Body body, int damage, int force, SpriteSheet ss)
	{
		super(w);
		this.name = name;
		this.description = description;
		this.body = body;
		this.damage = damage;
		this.force = force;
		this.sprites = ss;
	}
	
	public Body getBodyCopy()
	{
		//create new body and copy fields
		Body newBody = new Body("shot", new Box(body.getShape().getBounds().getWidth(), body.getShape().getBounds().getHeight()), body.getMass()); //size 5*5, mass 5
		newBody.setGravityEffected(body.getGravityEffected());
		newBody.setUserData(this); //link it with shot
		
		//return body
		return newBody;
	}
	
	public Image getImage()
	{
		return sprites.getSprite(0, 0);
	}
}
